from flask import Flask
from .views import blue
from .exts import init_exts


def creat_app():
    app = Flask(__name__)

    # 注册蓝图
    app.register_blueprint(blueprint=blue)

    # 配置数据库
    db_url = "sqlite:///sqlite3.db"
    app.config["SQLALCHEMY_DATABASE_URI"] = db_url #配置连接数据库路径db_url
    app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False #禁止对象追踪修改，因为对象追踪比较消耗资源


    return app